#!/bin/bash

# check env variable
[ -z "$WARP3D_HOME" ] && echo "Need to set WARP3D_HOME before proceeding." && exit 1

# cd here if required
cd $WARP3D_HOME/linux_packages/source/mpi_code_dir

printf " > Copying MPI code files into src for MPI-enabled WARP3D...\n"

       \rm ../../../src/mpi_code.f  ../../../src/mod_local_stiffness.f ../../../src/distributed_assembly.f ../../../src/mpi_handle_slaves.f
       \cp ./mpi_code_real.f ../../../src/mpi_code.f
printf "       mpi_code.f copied\n"
       \cp ./mod_local_stiffness_real.f ../../../src/mod_local_stiffness.f
printf "       mod_local_stiffness.f copied\n"
       \cp ./distributed_assembly_real.f ../../../src/distributed_assembly.f
printf "       distributed_assembly.f copied\n"
       \cp ./mpi_handle_slaves_real.f ../../../src/mpi_handle_slaves.f
printf "       mpi_handle_slaves.f copied\n"
